<template>
  <view style="padding: 20rpx 30rpx;">
    <u-navbar :border-bottom="false" title="账户报名列表"></u-navbar>
    <view v-for="(item,index) in res" :key="index" class="items u-f u-f-jsb">
      <view>
        <view class="u-f-ac">
          <view class="types" v-if="item.hasOwnProperty('margin_type')">{{radioList[item.margin_type].name}}</view>
          <view style="font-weight: 700;">{{item.real_name}}</view>
        </view>
        <view style="margin-top: 10rpx;">
          <view style="color: #666;">{{item.departure}}</view>
        </view>
      </view>
      <view style="text-align: right;">
        <view style="font-weight: 700;color: #DA3928;">{{item.mobile}}</view>
        <view class="u-f-ac" style="margin-top: 10rpx;">
          <view style="color: #999;">{{item.midentity}}</view>
        </view>
      </view>

    </view>
    <view v-if="res.length == 0" style="padding-top: 300upx;">
      <image src="/static/searchlist.png" mode="" style="display: block;margin: 0 auto;width: 240upx;height: 240upx;">
      </image>
      <view style="text-align: center;color: #999;">暂时没有任何记录</view>
    </view>
    <!-- <uni-load-more :loadingType="loadingType" :contentText="contentText"></uni-load-more> -->
  </view>
</template>

<script>
  import * as API_Haibao from '@/api/haibao.js';
  export default {
    data() {
      return {
        res: [{
            time: '2020-12-23 24:00:00',
            yeji: 123,
            remark: '申请中'
          },
          {
            time: '2020-12-23 24:00:00',
            yeji: 123,
            remark: '申请中'
          },
          {
            time: '2020-12-23 24:00:00',
            yeji: 123,
            remark: '申请中'
          },
        ],
        radioList: [{
            name: '补贴额度',
            value: 3000,
          },
          {
            name: '代金券',
            value: 1500,
          },
        ],
      };
    },
    onLoad: function() {
      this.getPromotionsActiveApplies()
    },
    // onPullDownRefresh() {
    //   this.page = 1
    //   this.loadingType = 0; //将loadingType归0重置
    //   this.setAjax()
    //   setTimeout(function() {
    //     uni.stopPullDownRefresh();
    //   }, 1000);
    // },

    // onReachBottom() {
    //   if (this.timer != null) {
    //     clearTimeout(this.timer)
    //   }
    //   this.timer = setTimeout(() => {
    //     this.getmorenews()
    //   }, 1000);
    // },

    methods: {
      async getPromotionsActiveApplies() {
        let res = await API_Haibao.getPromotionsActiveApplies()
        this.res = res
      },
    }
  }
</script>

<style lang="scss">
  page {
    background-color: #FAFAFA;
  }

  .items {
    padding: 40rpx 30upx;
    background-color: #FFFFFF;
    border-radius: 20upx;

    image {
      width: 44rpx;
      height: 44rpx;
    }
  }

  .types {
    height: 40rpx;
    padding: 4rpx 20rpx;
    background-color: #999;
    font-size: 20rpx;
    color: #FFFFFF;
    border-radius: 20rpx;
    margin-right: 10rpx;
  }
</style>
